<template>
  <div>
    <el-form :inline="true"
             class="demo-form-inline">
      <el-form-item>
        <el-input v-model="searchObj.name"
                  placeholder="讲师名" />
      </el-form-item>
      <el-form-item>
        <el-select v-model="searchObj.level"
                   clearable
                   placeholder="讲师头衔">
          <el-option :value="1"
                     label="高级讲师" />
          <el-option :value="2"
                     label="首席讲师" />
        </el-select>
      </el-form-item>

      <el-form-item label="添加时间">
        <el-date-picker v-model="searchObj.begin"
                        type="datetime"
                        placeholder="选择开始时间"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        default-time="00:00:00" />
      </el-form-item>
      <el-form-item>
        <el-date-picker v-model="searchObj.end"
                        type="datetime"
                        placeholder="选择截止时间"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        default-time="00:00:00" />
      </el-form-item>

      <el-button type="primary"
                 icon="el-icon-search"
                 @click="fetchData()">查询</el-button>
      <el-button type="default"
                 @click="resetData()">清空</el-button>

    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchObj: {}// 查询条件
    }
  },
  methods: {
    fetchData() {
      this.$emit('selectOptions', this.searchObj)
    },
    resetData() {
      this.searchObj = {}
      this.fetchData()
    }
  }
}
</script>

<style>
</style>
